import axios from './interceptor'
// 跟新邮箱授权码
const updateEmailPass = (emailpass: string) => {
  return axios.post('/emailer/emailpass', {
    emailpass,
  })
}
// 获取列表
const getAllUser = (page: number | string, username: string, email: string) => {
  return axios.get(
    `emailer?username=${username}&email=${email}&page=${page}&limite=5`
  )
}

// 用户管理 :删除单个
const delUser = (id: string | undefined, filename: string | undefined) => {
  return axios.get(`emailer/single?id=${id}&filename=${filename}`)
}

// 用户管理 :删除多个
const delBatch = (delBatchItem: string[], filenames: string[]) => {
  return axios.post('emailer/delBatch', {
    delBatchItem,
    filenames,
  })
}
export { updateEmailPass, getAllUser, delUser, delBatch }
